package com.fzkjjt.redislock.lock;

import org.redisson.api.RLock;

import java.util.concurrent.TimeUnit;

/**
 * @program: redis-lock
 * @description:
 * @author: FangZhen
 * @create: 2020-09-08 13:36
 **/
public interface DistributedLocker {

    RLock lock(String lockKey);

    RLock lock(String lockKey, int timeout);

    RLock lock(String lockKey, TimeUnit unit, int timeout);

    boolean tryLock(String lockKey, TimeUnit unit, int waitTime, int leaseTime);

    void unlock(String lockKey);

    void unlock(RLock lock);

    RLock getLock(String lockKey);
}
